#define _CRT_SECURE_NO_WARNINGS 
#include<iostream>
#include<deque>
#include<stack>
#include<queue>
#include<list>
using namespace std;
//void printDeque(deque<int>& deq)
//{
//#if 0
//	for (deque<int>::iterator it = deq.begin(); it != deq.end(); it++)
//	{
//		cout << *it << " ";
//	}
//	cout << endl;
//	for (auto it = deq.begin(); it != deq.end(); it++)
//	{
//		cout << *it << " ";
//	}
//#endif
//	for (int& ele : deq)
//	{
//		cout << ele << " ";
//	}
//	cout << endl;
//
//}
void printList(list<int>& l)
{
#if 0
	for (auto it = l.begin(); it != l.end(); it++)
	{
		cout << *it << " ";
	}
	cout << endl;
#else
	for (int& ele : l)
	{
		cout << ele << " ";
	}
	cout << endl;
#endif

}
int main()
{
	/*int array[] = { 1,2,3,4,5 };
	deque<int>deq(array, array + 5);
	printDeque(deq);
	deque<int>deq2(array, array + 3);
	printDeque(deq2);
	deque<int>dep2;
	dep2.assign(5, 3);
	printDeque(deq2);
	deq.swap(deq2);
	printDeque(deq);
	printDeque(dep2);
	deq.resize(10,1);
	printDeque(deq);
	deq.push_back(100);
	deq.push_front(200);
	printDeque(deq);
	int& ele = deq.at(3);
	ele = 10;*/
	//printDeque(deq);
	/*stack<int>s1;
	s1.push(10);
	s1.push(20);
	s1.push(30);
	int& ele = s1.top();
	cout << ele << endl;
	ele = 300;
	cout << s1.top() << endl;
	s1.pop();
	cout << s1.top() << endl;
	cout << s1.empty() << endl;
	cout << s1.size() << endl;
	int len = s1.size();
	for (int i = 0; i < len; i++)
	{
		cout << s1.top() << endl;
		s1.pop();
	}
	cout << s1.empty() << endl;*/
	/*queue<int>q;
	q.push(10);
	q.push(20);
	q.push(30);
	cout << q.front() << endl;
	cout << q.back() << endl;
	q.pop();
	cout << q.front() << endl;
	cout << q.empty() << endl;
	cout << q.size() << endl;*/
	int array[] = { 0,1,2,3,4,5,6,7,8,9 };
	list<int>l(array, array + 10);
	l.push_back(100);
	l.push_front(-100);
	printList(l);
	l.pop_back();
	l.pop_front();
	printList(l);
	//list<int>::iterator it = l.begin();
	auto it = l.begin();
	l.insert(it, 10);
	printList(l);
	return 0;
}